import szlschiefdata from 'szlschiefdata'

export const {
  BASE_SCREEN_WIDTH,
  BASE_SCREEN_HEIGHT,
  ApiModulesRoutes,
  MAX_INTEGER,
  MenuTypeEnum,
  constUrlFormat,
  SYSTEM_STATIC
} = szlschiefdata.consts


export const AccessUrl = {
  manageUrl:  process.env.VUE_APP_MANAGE_URL.replace(process.env.VUE_APP_PATH, window.location.hostname) ,
  frontUrl:  process.env.VUE_APP_FRONT_URL.replace(process.env.VUE_APP_PATH, window.location.hostname) ,
  indexUrl:  process.env.VUE_APP_INDEX_URL.replace(process.env.VUE_APP_PATH, window.location.hostname) ,
}



export const requestSourceEnum = 'MANEGE'

/**
 * 数据状态
 * @type {{STOP: string, CANCEL: string, NORMAL: string}}
 */
export const DataStatusEnum = {
  // 启用
  NORMAL: 'NORMAL',
  // 停用
  STOP: 'STOP',
  // 删除 (一般情况下不可能用到)
  CANCEL: 'CANCEL'
}


/**
 * constUrlFormat
 * @param {String} devUrl 开发环境地址
 * @param {String} prodUrl 生产环境地址 (如果没有该项，则开发和生产环境地址一致)
 */
export const CONST_URL = {
  // mqtt 服务器
  MQTT_URL: constUrlFormat('ws://47.107.60.73:8083/mqtt'),
  // 和信内网地址
  HE_XIN_URL: constUrlFormat('http://192.168.68.113:8800/#/user/login'),
}

export const OSS_STATIC_BASE_URL = 'http://47.107.60.73:9000'
export const OSS_STATIC_IMAGE_URL = `${OSS_STATIC_BASE_URL}/static/image`

// 排班管理枚举值
export const BusinessTypeEnum = {
  // 默认
  DEFAULT: 'DEFAULT',
  DEVICE: 'DEVICE',
  REGION: 'REGION',
  SECURITY: 'SECURITY',
  TRAIL: 'TRAIL',
  USER: 'USER'
}



export default {
  MenuTypeEnum,
  DataStatusEnum,
  ApiModulesRoutes,
  CONST_URL,
  AccessUrl,
  MAX_INTEGER,
  SYSTEM_STATIC,
  OSS_STATIC_BASE_URL,
  OSS_STATIC_IMAGE_URL
}
